Part Number Hot Search : 
M0365 Q144C 27900 AA1L3M RU2H30S HV507X RU5H8R 1N5453A
Product Description
Full Text Search
 

To Download MAXQ3120-FFN Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  general description the maxq3120 microcontroller is a high-performance, 16-bit microcontroller that incorporates dual, true-differen- tial, 16-bit sigma-delta analog-to-digital converters (adcs), a liquid-crystal display (lcd) interface that can drive up to 112 segments, and a real-time clock (rtc) module with a dedicated battery-backup supply. the maxq3120 is uniquely suited for the single-phase elec- tricity metering market, but can be used in any applica- tion that requires high-performance operation. the device can operate at a maximum of 8mhz (dv dd = 3.3v). the maxq3120 has 16kwords of flash memory, 256 words of ram, three 16-bit timers, and two universal synchro- nous/asynchronous receiver/transmitters (usarts). the microcontroller core and i/o are powered by a single 3.3v supply, and an additional battery supply keeps the rtc running during power outages. features ? high-performance, low-power, 16-bit risc core dc to 8mhz operation, approaching 1mips per mhz 3.3v core and i/o 33 instructions, most single-cycle three independent data pointers accelerate data movement with automatic increment/ decrement 16-level hardware stack 16-bit instruction word, 16-bit data bus 16 x 16-bit, general-purpose working registers optimized for c-compiler (high-speed/density code) ? program and data memory 16kwords flash memory 1,000,000 flash write/erase cycles 256 words of internal data ram jtag bootloader for programming ? dual, 16-bit sigma-delta adcs differential analog input channels programmable gain of 1x or 16x integrated sinc 3 filters digital phase compensation and trimmable bandgap reference ? peripheral features up to 32 general-purpose i/o pins 112-segment lcd driver up to 4 com and 28 segments static, 1/2, and 1/3 lcd bias supported no external resistors required two serial usarts, one with infrared pwm support one-cycle, 16 x 16 hardware multiply/ accumulate with 40-bit accumulator three 16-bit programmable timers/counters, one with infrared pwm support 8-bit, subsecond, system timer/alarm battery-backed, 32-bit rtc with time-of-day alarm and digital trim programmable watchdog timer ? flexible programming interface bootloader simplifies programming in-system programming through jtag supports in-application programming of flash memory ? power consumption < 28ma at 8mhz, 3.3v flash operation 320? standby current in sleep mode low-power divide-by-256 mode maxq3120 high-precision adc mixed-signal microcontroller ______________________________________________ maxim integrated products 1 rev 1; 8/05 for pricing, delivery, and ordering information, please contact maxim/dallas direct! at 1-888-629-4642, or visit maxim? website at www.maxim-ic.com. selector guide, typical operating circuit, and pin configuration appear at end of data sheet. note: some revisions of this device may incorporate deviations from published specifications known as errata. multiple revi- sions of any device may be simultaneously available through various sales channels. for information about device errata, go to: www.maxim-ic.com/errata . maxq is a trademark of maxim integrated products, inc. + denotes a pb-free/rohs-compliant device. ordering information part temp range pin-package MAXQ3120-FFN -40? to +85? 80 mqfp MAXQ3120-FFN+ -40? to +85? 80 mqfp single-phase electricity metering battery-powered and portable devices electrochemical and optical sensors industrial control data-acquisition systems and data loggers home appliances consumer electronics thermostats/humidity sensors security sensors gas and chemical sensors hvac smart transmitters applications
maxq3120 high-precision adc mixed-signal microcontroller 2 _____________________________________________________________________ absolute maximum ratings electrical characteristics (dv dd , av dd = v rst to 3.6v, v ref = 1.25v (external), f hfxin = 8mhz, t a = -40? to +85?, unless otherwise noted.) (note 1) stresses beyond those listed under ?bsolute maximum ratings?may cause permanent damage to the device. these are stress rating s only, and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of the specificatio ns is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. voltage range on dv dd relative to dgnd ..........-0.3v to +4.0v voltage range on av dd relative to agnd...........-0.3v to +4.0v voltage range on agnd relative to dgnd .........-0.3v to +0.3v voltage range on av dd relative to dv dd ............-0.3v to +0.3v voltage range on any pin relative to dgnd except an0+, an0-, an1+, an1-.........-0.3v to (dv dd + 0.5v) voltage range on an0+, an0-, an1+, an1- relative to agnd ......................................-4.0v to +4.0v operating temperature range ...........................-40? to +85? junction temperature ......................................................+150? storage temperature range .............................-65? to +150? soldering temperature .......................................see ipc/jedec j-std-020 specification parameter symbol conditions min typ max units digital supply voltage dv dd v rst 3.3 3.6 v digital supply ramp rate can be controlled by placing a 1? or higher capacitor between dv dd and ground -16 +16 v/ms digital power-fail reset v rst 2.8 2.9 3.03 v i dd1 /1 mode 21 28 i dd2 /2 mode 11 i dd3 /4 mode 5.7 i dd4 /8 mode 3.1 active current (note 2) i dd5 pmm mode 1.0 ma stop-mode current (dv dd plus av dd ) i stop 320 760 ? battery supply voltage v bat 1.8 3.8 v battery current i bat rtce = 1, dv dd = 0v, v bat = 3.6v 5.1 10 ? input high voltage v ih 0.7 x dv dd dv dd + 0.3 v input low voltage v il -0.3 0.3 x dv dd v input hysteresis (schmitt) v ihys 0.6 v i oh = +1.5ma dv dd - 0.4 output high voltage (all ports) v oh i oh = +2.5ma dv dd - 0.5 v i ol = 3ma sink current 0.4 output low voltage (all ports, reset ) v ol i ol = 3.65ma sink current 0.5 v input low current (all ports) i il v il = 0.4v; weak pullup enabled -50 ? reset pullup resistance r rst 50 100 200 k ? input leakage (all ports) i l weak pullup disabled -1 +1 ?
maxq3120 high-precision adc mixed-signal microcontroller _____________________________________________________________________ 3 electrical characteristics (continued) (dv dd , av dd = v rst to 3.6v, v ref = 1.25v (external), f hfxin = 8mhz, t a = -40? to +85?, unless otherwise noted.) (note 1) parameter symbol conditions min typ max units analog supply voltage av dd av dd = dv dd 2.8 3.3 3.6 v active analog supply current i avdd normal operation 2.65 3.5 ma power-down analog supply current apd2:0 = 111b 250 635 ? analog-to-digital converter dc accuracy adc resolution no missing codes, with software lowpass filter (see appendix a) 16 bits offset error gain = 1 ?.0 mv gain error gain = 1 ?.0 % gain-error drift ?0 ppm gain-error match ?.5 % dc power-supply rejection psrr an0+, an0- = agnd; av dd = 3.0v to 3.6v 80 db analog-to-digital converter dynamic specifications dv dd = 3.3v, av dd = 3.3v, an0 = 25mv, peak-to-peak sine wave at 65hz, gain = 16 48 57 with software lowpass filter, cutoff at 21st harmonic (see appendix a) 71 signal-to-noise ratio snr with software lowpass filter, cutoff at 7th harmonic (see appendix a) 74 db total harmonic distortion thd dv dd = 3.3v, av dd = 3.3v, an0 = 25mv, peak-to-peak sine wave at 65hz, gain = 16 (up to 21st harmonic) -79 -55 db analog-to-digital converter inputs input-voltage range an0+, an0-; an1+, an1- to agnd -1 +1 v gain = 1 1 input sampling capacitance (note 3) c in channel 0 gain = 16 16 pf input sampling rate f s (note 4) 1.33 mhz sample output rate f hfxin / 384 sample / sec gain = 1 750 input impedance to agnd (note 5) gain = 16 46 k ? gain = 1 1500 differential input impedance (note 6) gain = 16 93 k ? input bandwidth (-3db) 5.5 khz reference input voltage v ref 1.2 1.25 1.3 v reference input sampling capacitance 2pf reference input sampling rate f s 1.33 mhz
maxq3120 high-precision adc mixed-signal microcontroller 4 _____________________________________________________________________ note 1: specifications to -40? are guaranteed by design and not production tested. all typical values are guaranteed by design characterization and are not production tested. note 2: tested with t a = +25?, dv dd = 3.3v, and all peripherals inactive except for port pins. note 3: these numbers are guaranteed by design and are not tested. note 4: can be calculated as (f hfxin / 6). note 5: can be calculated as 6 / (f hfxin x c in ). note 6: can be calculated as 12 / (f hfxin x c in ). note 7: assumes that no external components are connected to v lcd , v lcd1 , v lcd2 , or v adj . electrical characteristics (continued) (dv dd , av dd = v rst to 3.6v, v ref = 1.25v (external), f hfxin = 8mhz, t a = -40? to +85?, unless otherwise noted.) (note 1) parameter symbol conditions min typ max units internal reference reference output voltage 1.25 v ?20 reference-output temperature coefficient with v ref bandgap trimming (atrm[4:0] = 01111b) ?5 ppm/? load regulation i ref = ??, c l = 12pf ?0 ?00 ?/? lcd interface lcd reference voltage v lcd dv dd v lcd bias voltage 1 v lcd1 guaranteed by design v adj + 2/3 (v lcd - v adj ) v lcd bias voltage 2 v lcd2 guaranteed by design v adj + 1/3 (v lcd - v adj ) v lcd adjustment voltage (note 7) v adj guaranteed by design 0 0.4 x v lcd v lcd bias resistor r lcd 20 k ? lcd adjust resistor r ladj lra4:lra0 = 0 40 k ? segment is driven at v lcd ; v lcd = 3v, i segxx = -3?, guaranteed by design v lcd - 0.02 v lcd v segment is driven at v lcd1 ; v lcd1 = 2v, i segxx = -3?, guaranteed by design v lcd1 - 0.02 v lcd1 v segment is driven at v lcd2 ; v lcd2 = 1v, i segxx = -3?, guaranteed by design v lcd2 - 0.02 v lcd2 v lcd segment voltage v segxx segment is driven at v adj ; v adj = 0v, i segxx = +3?, guaranteed by design v adj 0.1 v clock source external crystal frequency f hfxin 18 mhz real-time clock rtc input frequency f 32kin 32khz watch crystal 32.768 khz jtag/flash programming jtag clock rate f tck sysclk / 8 mass erase 904 flash erase time page erase 313 ms flash programming time 17 s write/erase cycles 1,000,000 cycles data retention 20 years
maxq3120 high-precision adc mixed-signal microcontroller _____________________________________________________________________ 5 digital supply current vs. clock frequency maxq3120 toc01 f hfxin (mhz) i dd1 (ma) 7 6 5 4 3 10 15 20 25 5 28 d vdd = +3.6v t a = +85 c t a = -40 c, +25 c port pin high output voltage vs. source current maxq3120 toc02 i oh (ma) v oh (v) 8 6 4 2 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 1.8 010 d vdd = 2.8v t a = +85 c t a = +25 c t a = -40 c port pin low-output voltage vs. sink current maxq3120 toc03 i ol (ma) v ol (v) 8 6 4 2 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0 010 d vdd = 2.8v t a = +85 c t a = +25 c t a = -40 c reference voltage output vs. load current maxq3120 toc04 i ref ( a) v ref (v) 50 0 -50 1.25 1.26 1.27 1.28 1.29 1.24 -100 100 a vdd = 3.3v t a = +25 c t a = +85 c t a = -40 c signal-to-noise ratio vs. input frequency maxq3120 toc05 input frequency (khz) snr (db) 9 8 7 6 5 4 3 2 1 50 55 60 45 010 v ref = +1.25v a vdd = 3.3v t a = +25 c, +85 c t ypical operating characteristics (t a = +25?, unless otherwise noted.)
maxq3120 high-precision adc mixed-signal microcontroller 6 _____________________________________________________________________ pin description pin name function 22, 38, 60, 74 dv dd digital supply voltage (+3.3v) 19, 37, 43, 59, 75 dgnd digital ground 44 av dd analog supply voltage 52 agnd analog ground 12 v lcd lcd bias-control voltage. highest lcd drive voltage used in all bias modes. this pin must be connected to an external supply when using the lcd display controller. 13 v lcd1 lcd bias, voltage 1. next highest lcd drive voltage, used in 1/2 and 1/3 lcd bias modes. an internal resistor-divider sets the voltage at this pin. external resistors and capacitors can be used to change lcd voltage or drive capability at this pin. this pin must be shunted externally to v lcd2 when using 1/2 bias mode. 14 v lcd2 lcd bias, voltage 2. third highest lcd drive voltage, used in 1/3 lcd bias mode only. an internal resistor-divider sets the voltage at this pin. external resistors and capacitors can be used to change lcd voltage or drive capability at this pin. this pin must be shunted externally to v lcd1 when using 1/2 bias mode. 15 v adj lcd adjustment voltage. lowest lcd drive voltage, used in all bias modes. connect to dgnd through an external resistor to provide external control of the lcd contrast. leave disconnected for internal contrast adjustment. 63 reset digital, active-low, reset input/output. the cpu is held in reset when this is low and begins executing from the reset vector when released. the pin includes a pullup current source and should be driven by an open-drain, external source capable of sinking in excess of 2ma. this pin is driven low as an output when an internal reset condition occurs. 20 hfxin high-frequency crystal input. connect an external crystal between hfxin and hfxout to generate the high-frequency system clock. hfxin and hfxout contain integral 16pf load capacitors, so no external capacitor is required. 21 hfxout high-frequency crystal output. connect an external crystal between hfxin and hfxout to generate the high-frequency system clock. hfxin and hfxout contain integral 16pf load capacitors, so no external capacitor is required. 53 v bat digital battery-backup supply. this supply provides an optional battery backup for the rtc when dv dd power is removed. if this supply is not provided, all functions of the device operate as normal, but the rtc is cleared upon power-on reset (por). 61 32kin 32khz crystal input. connect an external, 32khz watch crystal between 32kin and 32kout to generate the 32khz system clock. this clock is required for the rtc to operate. 62 32kout 32khz crystal output. connect an external, 32khz watch crystal between 32kin and 32kout to generate the 32khz system clock. this clock is required for the rtc to operate. 51 v ref voltage reference input/output. bias voltage (+1.25v) for the adcs. an external reference voltage can be connected to this pin when extremely high accuracy is required. 45 an0- negative input for sigma-delta adc channel 0 46 an0+ positive input for sigma-delta adc channel 0 47 an1- negative input for sigma-delta adc channel 1 48 an1+ positive input for sigma-delta adc channel 1
maxq3120 high-precision adc mixed-signal microcontroller _____________________________________________________________________ 7 pin description (continued) pin name function general-purpose, digital, i/o, type-d port; external edge-selectable interrupt. these port pins function as bidirectional i/o pins only. all port pins default to input mode with weak pullups enabled after a reset. port pins p0.3, p0.4, and p0.5 can be configured as external interrupt inputs. all alternate functions must be enabled from software. pin port alternate functions 64 p0.0 rtc square-wave output 65 p0.1 serial port 0 receive 66 p0.2 serial port 0 transmit 67 p0.3 timer 0 gate input int0 68 p0.4 timer 0 input int1 69 p0.5 timer 1 input/output int2 70 p0.6 timer 2 input/output a (t2p) 64?1 p0.0?0.7/ sqw, rxd0, txd0, int0?nt2/ t2a, t2b/ t0g, t0, t1 71 p0.7 timer 2 input/output b (t2pb) g e n e r a l - pu r p o s e , 8 - b i t , d i g i t a l , i/ o , t y p e - c po r t ; lc d se g m e n t - d r iv e r ou t p u t . these p or t p i ns functi on as b oth b i d i r ecti onal i/o p i ns and lc d seg m ent- d r i ve ou tp uts. al l p or t p i ns d efaul t to i np ut m od e w i th w eak p ul l up s enab l ed after a r eset. s etti ng t he lc d enab l e ( p c fx) b i t for a g r oup of four p or t p i ns enab l es the lc d functi on and d i sab l es the g ener al - p ur p ose i/o functi on on al l p i ns i n that g r oup . pin port lcd segment lcd enable 76 p1.0 seg19 77 p1.1 seg18 78 p1.2 seg17 79 p1.3 seg16 pcf1 80 p1.4 seg15 1 p1.5 seg14 2 p1.6 seg13 76?0, 1, 2, 3 p1.0?1.7/ seg19 seg12 3 p1.7 seg12 pcf0 g e n e r a l - pu r p o s e , 8 - b i t , d i g i t a l , i/ o , t y p e - c po r t ; lc d se g m e n t - d r iv e r ou t p u t . these p or t p i ns functi on as b oth b i d i r ecti onal i/o p i ns and lc d seg m ent- d r i ve ou tp uts. al l p or t p i ns d efaul t to i np ut m od e w i th w eak p ul l up s enab l ed after a r eset. s etti ng the lc d enab l e ( p c fx) b i t for a g r oup of four p or t p i ns enab l es the lc d functi on and d i sab l es the g ener al - p ur p ose i/o functi on on al l p i ns i n that g r oup . pin port lcd segment lcd enable 28 p2.0 seg20 29 p2.1 seg21 30 p2.2 seg22 31 p2.3 seg23 pcf2 32 p2.4 seg24 33 p2.5 seg25 34 p2.6 seg26 28?4, 39 p2.0?2.7/ seg20 seg27 39 p2.7 seg27 pcf3
maxq3120 high-precision adc mixed-signal microcontroller 8 _____________________________________________________________________ pin description (continued) pin name function general-purpose, 8-bit, digital, i/o, type-c port. these port pins function as bidirectional i/o pins only. all port pins default to input mode with weak pullups enabled after a reset. jtag functions are enabled by default following reset; all other alternate functions must be enabled from software. pin port alternate function 40 p3.0 tdo?tag data out 41 p3.1 tdi?tag data in 42 p3.2 tms?tag mode select 54 p3.3 tck?tag clock 55 p3.4 56 p3.5 57 p3.6 serial port 1 transmit 40, 41, 42, 54?8 p3.0?3.7/ tdo, tdi, tms, tck, txdi, rxdi 58 p3.7 serial port 1 receive 23 seg0 lcd segment 0 driver. dedicated lcd drive output. 18 seg1 lcd segment 1 driver. dedicated lcd drive output. 17 seg2 lcd segment 2 driver. dedicated lcd drive output. 16 seg3 lcd segment 3 driver. dedicated lcd drive output. 11 seg4 lcd segment 4 driver. dedicated lcd drive output. 10 seg5 lcd segment 5 driver. dedicated lcd drive output. 9 seg6 lcd segment 6 driver. dedicated lcd drive output. 8 seg7 lcd segment 7 driver. dedicated lcd drive output. 7 seg8 lcd segment 8 driver. dedicated lcd drive output. 6 seg9 lcd segment 9 driver. dedicated lcd drive output. 5 seg10 lcd segment 10 driver. dedicated lcd drive output. 4 seg11 lcd segment 11 driver. dedicated lcd drive output. 27 com0 lcd common 0 driver. dedicated lcd common-voltage output. 26 com1 lcd common 1 driver. dedicated lcd common-voltage output. 25 com2 lcd common 2 driver. dedicated lcd common-voltage output. 24 com3 lcd common 3 driver. dedicated lcd common-voltage output. 35, 36, 49, 50, 72, 73 n.c. no connection
maxq3120 high-precision adc mixed-signal microcontroller _____________________________________________________________________ 9 functional diagram dgnd v adj seg[11:0] com[3:0] v lcd2 lcd driver 14 x 8 lcd display ram 32khz clock 256 x 16 sram 16k x 16 (32kb) flash register file serial usart 0 port pin pad drivers infrared control interrupt controller watchdog timer timer 0 t0int t1int t2int timer 1 timer 2 rxd0 txd0 rxd1 txd1 serial usart 1 dp[0] dp[1] bp[offs] 16 x 16 hw multiply v lcd1 v lcd adc analog front end channel 0 modulator channel 1 modulator channel 0 output channel 1 output front channel 0 sinc 3 filter channel 0 and 1 phase delay channel 1 sinc 3 filter av dd an0+ an0- an1+ an1- agnd dgnd seg[27:12] dv dd p0.3/int0/t0g extint u0int u1int dv dd p3.2/tms p3.1/tdi p3.0/tdo p3.3/tck dgnd reset hfxin hfxout 32k osc hf osc clk div wd div jtag bootload and debug interface 16-bit risc cpu core timer clocks real-time clock, alarms (battery backed) 32kout 32kin v bat wdc time of day, interval wdc v ref maxq3120 p0.4/int1/t0 t0 t0g t1 t2 t2b p0.5/int2/t1 p0.6/t2a p0.7/t2b p0.0/sqw p0.1/rxd0 p0.2/txd0 p3.7/rxd1 p3.6/txd1 p3.4 p3.5 p1[7:0] seg[12:19] p2[7:0] seg[27:20]
maxq3120 high-precision adc mixed-signal microcontroller 10 ____________________________________________________________________ detailed description the following is an introduction to the primary features of the microcontroller. more detailed descriptions of the device features can be found in the data sheets, errata sheets, and user? guides described later in the additional documentation section. maxq core architecture the maxq3120 is a low-cost, high-performance, cmos, 16-bit risc microcontroller with flash memory and an integrated 112-segment lcd controller. it is structured on a highly advanced, accumulator-based, 16-bit risc architecture. fetch and execution opera- tions are completed in one cycle without pipelining, because the instruction contains both the op code and data. the result is a streamlined 8 million instructions- per-second (mips) microcontroller. the highly efficient core is supported by a 16-level hardware stack, enabling fast subroutine calling and task switching. data can be quickly and efficiently manipulated with three internal data pointers. multiple data pointers allow more than one function to access data memory without having to save and restore data pointers each time. the data pointers can automatically increment or decrement following an operation, elimi- nating the need for software intervention. as a result, the application speed is greatly increased. instruction set the instruction set is composed of fixed-length, 16-bit instructions that operate on registers and memory loca- tions. the instruction set is highly orthogonal, allowing arithmetic and logical operations to use any register along with the accumulator. system registers control functionality common to all maxq microcontrollers, while peripheral registers control peripherals and func- tions specific to the maxq3120. all registers are subdi- vided into register modules. the family architecture is modular, so that new devices and modules can reuse code developed for existing products. the architecture is transport-triggered. this means that writes or reads from certain register locations can also cause side effects to occur. these side effects form the basis for the higher-level op codes defined by the assembler, such as addc, or, jump, etc. the op codes are actually implemented as move instructions between certain system register locations, while the assembler handles the encoding, which need not be a concern to the programmer. the 16-bit instruction word is designed for efficient exe- cution. bit 15 indicates the format for the source field of the instruction. bits 0 to 7 of the instruction represent the source for the transfer. depending on the value of the format field, this can either be an 8-bit immediate value or a source register. if this field represents a register, the lower four bits contain the module specifier and the upper four bits contain the register index in that module. bits 8 to 14 represent the destination for the transfer. this value always represents a destination register, with the lower four bits containing the module specifier and the upper three bits containing the register subindex within that module. the following types of instructions require the use of the prefix register, pfx, to supply additional data. loading a 16-bit immediate value (with a nonzero high byte) into any register branching to a 16-bit absolute destination address (ljmp or lcall) selecting one of the upper 8 registers in a system register module as a destination selecting one of the upper 16 registers in a periph- eral register module as a source selecting one of the upper 24 registers in a periph- eral register module as a destination for any of these instruction types, the prefix register is used to supply the additional immediate value bits, source bits, and destination bits as needed. this prefix register write is inserted automatically by the assembler and requires only one additional execution cycle for any or all of these conditions. memory organization the device incorporates several memory areas: 2kwords utility rom 16kwords of flash memory for program storage 256 words of sram for storage of temporary vari- ables 16-level, 16-bit-wide stack memory for storage of program return addresses and general-purpose use the memory is arranged by default in a harvard archi- tecture, with separate address spaces for program and data memory. the configuration of program and data space depends on the current execution location. when executing code from flash memory, the sram and utility rom are accessible in data space. when executing code from sram, the flash memory and utility rom are accessible in data space. when executing code from the utility rom, the flash memory and sram are accessible in data space.
maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 11 refer to the user? guide supplement for this device for more details. in all cases, whichever memory segment is currently being executed from cannot be accessed in data space. to allow the use of lookup tables and similar constructs in the flash memory, the utility rom contains a set of lookup and block copy routines (refer to the user? guide supplement for this device for more details). the incorporation of flash memory allows the device to be reprogrammed, eliminating the expense of throwing away one-time programmable devices during develop- ment and field upgrades. flash memory can be pass- word protected with a 16-word key, denying access to program memory by unauthorized individuals. stack memory a 16-bit-wide internal stack provides storage for pro- gram return addresses and general-purpose use. the stack is used automatically by the processor when the call, ret, and reti instructions are executed and interrupts serviced. the stack can also be used explic- itly to store and retrieve data by using the push, pop, and popi instructions. on reset, the stack pointer, sp, initializes to the top of the stack (0fh). the call, push, and interrupt-vector- ing operations increment sp, then store a value at the stack location pointed to by sp. the ret, reti, pop, and popi operations retrieve the value at the stack location pointed to by sp, and then decrement sp. utility rom the utility rom is a 2kword block of internal rom memory that defaults to a starting address of 8000h. the utility rom consists of subroutines that can be called from application software. these include: in-system programming (bootloader) over the jtag interface in-circuit debug routines test routines (internal memory tests, memory loader, etc.) user-callable routines for in-application flash pro- gramming and code space table lookup figure 1. memory map data space (word mode) 87ffh 8000h 00ffh 0000h a0ffh a000h data space (byte mode) 8fffh 8000h 01ffh 0000h 87ffh 3fffh 8000h 0000h system registers program space 256 x 16 data sram 2k x 16 utility rom 4k x 8 utility rom 512 x 8 data sram 256 x 16 data sram 2k x 16 utility rom 16 x 16 stack m0 x0h x1fh m1 m2 m3 0xh 1xh 2xh 3xh ap x0h xfh a pfx ip 8xh 9xh bxh sp dpc dp dxh exh fxh cxh peripheral registers 16k x 16 program flash or masked rom
maxq3120 following any reset, execution begins in the utility rom. the rom software determines whether the pro- gram execution should immediately jump to the start of user-application code (located at address 0000h), or to one of the special routines mentioned. routines within the utility rom are user-accessible and can be called as subroutines by the application software. more infor- mation on the utility rom contents is contained in the user? guide supplement for this device. some applications require protection against unautho- rized viewing of program code memory. for these applications, access to in-system programming, in- application programming, or in-circuit debugging func- tions is prohibited until a password has been supplied. a single password-lock (pwl) bit is implemented in the sc register. when the pwl is set to one (power-on reset default), the password is required to access the utility rom, including in-circuit debug and in-system programming routines that allow reading or writing of internal memory. when pwl is cleared to zero, these utilities are fully accessible without the password. the password is automatically set to all ones following a mass erase. programming the flash memory of the microcontroller can be pro- grammed by two different methods: in-system program- ming and in-application programming. both methods afford great flexibility in system design as well as reduce the life-cycle cost of the embedded system. these fea- tures can be password protected to prevent unautho- rized access to code memory. in-system programming an internal bootstrap loader allows the device to be reloaded over a simple jtag interface. as a result, sys- tem software can be upgraded in-system, eliminating the need for a costly hardware retrofit when software updates are required. remote software uploads are possible that enable physically inaccessible applica- tions to be frequently updated. the interface hardware can be a jtag connection to another microcontroller, or a connection to a pc serial port using a serial-to-jtag converter such as the maxqjtag-001, available from maxim integrated products/dallas semiconductor. if in- system programmability is not required, a commercial gang programmer can be used for mass programming. activating the jtag interface and loading the test access port (tap) with the system programming instruc- tion invokes the bootloader. setting the spe bit to 1 dur- ing reset through the jtag interface executes the bootloader-mode program that resides in the utility rom. when programming is complete, the bootloader can clear the spe bit and reset the device, allowing the device to bypass the utility rom and begin execution of the application software. the following bootloader functions are supported: load dump crc ? erify erase in-application programming the in-application programming feature allows the microcontroller to modify its own flash program memory while simultaneously executing its application software. this allows on-the-fly software updates in mission-criti- cal applications that cannot afford downtime. alternatively, it allows the application to develop custom loader software that can operate under the control of the application software. the utility rom contains user- accessible flash programming functions that erase and program flash memory. these functions are described in detail in the user? guide supplement for this device. register set most functions of the device are controlled by sets of registers. these registers provide a working space for memory operations as well as configuring and address- ing peripheral registers on the device. registers are divided into two major types: system registers and peripheral registers. the common register set, also known as the system registers, includes the alu, accu- mulator registers, data pointers, interrupt vectors and control, and stack pointer. the peripheral registers define additional functionality that may be included by different products based on the maxq architecture. this functionality is broken up into discrete modules so that only the features required for a given product need to be included. tables 1 and 4 show the maxq3120 register set. high-precision adc mixed-signal microcontroller 12 ____________________________________________________________________
maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 13 table 1. system register map register index ap (8h) a (9h) pfx ( bh) ip ( ch) sp ( dh) dpc ( eh) dp ( fh) 0xh ap a[0] pfx ip 1xh apc a[1] sp 2xh a[2] iv 3xh a[3] offs dp[0] 4xh psf a[4] dpc 5xh ic a[5] gr 6xh imr a[6] lc[0] grl 7xh a[7] lc[1] bp dp[1] 8xh sc a[8] grs 9xh a[9] grh axh a[10] grxl bxh iir a[11] bp[offs] cxh a[12] dxh a[13] exh ckcn a[14] fxh wdcn a[15] note: names that appear in italics indicate that all bits of a register are read-only. names that appear in bold indicate that a regi ster is 16 bits wide. registers in module ap are bit addressable.
maxq3120 high-precision adc mixed-signal microcontroller 14 ____________________________________________________________________ table 2. system register bit functions register bit register 15 14 13 12 11 10 98 76 54 3210 ap ap (4 bits) apc clr ids mod2 mod1 mod0 psf zs gpf1 gpf0 ov ce ic cgds ins ige imr ims im3 im2 im1 im0 sc tap rod pwl iir iis ii3 ii2 ii1 ii0 ckcn stop swb pmme cd1 cd0 wdcn por ewdi wd1 wd0 wdif wtrf ewt rwt a[0..15] a[n] (16 bits) pfx pfx (16 bits) ip ip (16 bits) sp sp (4 bits) iv iv (16 bits) lc[0] lc[0] (16 bits) lc[1] lc[1] (16 bits) offs offs (8 bits) dpc wbs2 wbs1 wbs0 sdps1 sdps0 gr gr (16 bits) grl gr.7 gr.6 gr.5 gr.4 gr.3 gr.2 gr.1 gr.0 bp bp (16 bits) grs gr.7 gr.6 gr.5 gr.4 gr.3 gr.2 gr.1 gr.0 gr.15 gr.14 gr.13 gr.12 gr.11 gr.10 gr.9 gr.8 grh gr.15 gr.14 gr.13 gr.12 gr.11 gr.10 gr.9 gr.8 grxl gr.7 gr.7 gr.7 gr.7 gr.7 gr.7 gr.7 gr.7 gr.7 gr.6 gr.5 gr.4 gr.3 gr.2 gr.1 gr.0 bp[offs] bp[offs] (16 bits) dp[0] dp[0] (16 bits) dp[1] dp[1] (16 bits)
maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 15 table 3. system register reset values register bit register 15 14 13 12 11 10 9876543210 ap 00000000 apc 00000000 psf ii 000000 ic 00000000 imr 00000000 sc 10 iii 000 iir 00000000 ckcn 10000000 wdcn ss 000 ss 0 a[0..15] iiiiiiiiiiiiiiii pfx 0000000000000000 ip 1000000000000000 sp 0000000000001111 iv 0000000000000000 lc[0] 0000000000000000 lc[1] 0000000000000000 offs 00000000 dpc 0000000000011100 gr 0000000000000000 grl 00000000 bp 0000000000000000 grs 0000000000000000 grh 00000000 grxl 0000000000000000 bp[offs] 0000000000000000 dp[0] 0000000000000000 dp[1] 0000000000000000 note: bits marked with an ??have an indeterminate value upon reset. bits marked with an ??have special behavior upon reset. refer to the user? guide supplement for this device for more details.
maxq3120 high-precision adc mixed-signal microcontroller 16 ____________________________________________________________________ table 4. peripheral register map register index m0 (0h) m1 (1h) m2 (2h) m3 (3h) m4 (4h) m5 (5h) 00h po0 t0cn t1cn mcnt 01h po1 t0l t1l ma 02h po2 t0h t1h mb 03h po3 scon0 t2cna mc2 04h sbuf0 t2h mc1 05h scon1 t2rh mc0 06h eif0 sbuf1 t2ch mc1r 07h eie0 ircn mc0r 08h pi0 t1cl adcn 09h pi1 smd0 t1ch phc 0ah pi2 pr0 t1md ad0 0bh pi3 smd1 t2cnb ad1 0ch eies0 pr1 t2v atrm 0dh t2r lcra 0eh t2c lcfg 0fh t2cfg 10h pd0 lcd0 11h pd1 lcd1 12h pd2 lcd2 13h pd3 lcd3 14h lcd4 15h lcd5 16h lcd6 17h lcd7 18h rtrm lcd8 19h rcnt lcd9 1ah rtss lcd10 1bh rtsh icdf lcd11 1ch rtsl lcd12 1dh rssa lcd13 1eh rash 1fh rasl note: names that appear in italics indicate that all bits of a register are read-only. names that appear in bold indicate that a regi ster is 16 bits wide. registers in module ap are bit addressable.
maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 17 table 5. peripheral register bit functions register bit register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 po0 po0 (8 bits) po1 po1 (8 bits) po2 po2 (8 bits) po3 po3 (8 bits) eif0 ie2 ie1 ie0 eie0 ex2 ex1 ex0 pi0 pi0 (8 bits) pi1 pi1 (8 bits) pi2 pi2 (8 bits) pi3 pi3 (8 bits) eies0 it2 it1 it0 pd0 pd0 (8 bits) pd1 pd1 (8 bits) pd2 pd2 (8 bits) pd3 pd3 (8 bits) rtrm tsgn trm (5 bits) rcnt we ft sqe alsf aldf rdye rdy busy ase ade rtce rtsh rtsh (16 bits) rtsl rtsl (16 bits) rssa rssa (11 bits) rash rash (4 bits) rasl rasl (16 bits) t0cn et0 t0m tf0 tr0 gate c/t m1 m0 t0l t0l (8 bits) t0h t0h (8 bits) scon0 sm0/fe sm1 sm2 ren tb8 rb8 ti ri sbuf0 sbuf0 (8 bits) scon1 sm0/fe sm1 sm2 ren tb8 rb8 ti ri sbuf1 sbuf1 (8 bits) smd0 epwm ofs esi smod fede pr0 pr0 (16 bits) smd1 esi smod fede pr1 pr1 (16 bits)
maxq3120 high-precision adc mixed-signal microcontroller 18 ____________________________________________________________________ table 5. peripheral register bit functions (continued) register bit register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 icdf pss1 pss0 spe t1cn tf1 exf1 t1oe dcen exen1 tr1 c/t1 cprl1 t1l t1l (8 bits) t1h t1h (8 bits) t2cna et2 t2oe0 t2pol0 tr2l tr2 cprl2 ss2 g2en t2h t2v[15:8] (8 bits) t2rh t2r[15:8] (8 bits) t2ch t2c[15:8] (8 bits) ircn iren irtx irbb t1cl t1cl (8 bits) t1ch t1ch (8 bits) t1md et1 t1m t2cnb et2l t2oe1 t2pol1 tf2 tcc2 tf2l tc2l t2v t2v (16 bits) t2r t2r (16 bits) t2c t2c (16 bits) t2cfg t2ci div2 div1 div0 t2md ccf1 ccf0 c/t2 mcnt of mcw cld squ opcs msub mmac sus ma ma (16 bits) mb mb (16 bits) mc2 mc2 (8 bits) mc1 mc1 (16 bits) mc0 mc0 (16 bits) mc1r mc1r (16 bits) mc0r mc0r (16 bits) adcn g3 g2 g1 g0 apd2 apd1 apd0 uff edbi flu1 flu0 fov1 fov0 abf1 abf0 phc zps ph (9 bits) ad0 ad0 (16 bits) ad1 ad1 (16 bits) atrm abgt (5 bits) lcra duty1 duty0 frm3 frm2 frm1 frm0 lccs lrig lra3 lra2 lra1 lra0 lcfg pcf3 pcf2 pcf1 pcf0 opm dpe lcd[0..13] lcd[n] (8 bits)
maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 19 table 6. peripheral register bit reset values register bit register 15 14 13 12 11 10 9876543210 po0 11111111 po1 11111111 po2 11111111 po3 11111111 eif0 00000000 eie0 00000000 pi0 ssssssss pi1 ssssssss pi2 ssssssss pi3 ssssssss eies0 00000000 pd0 00000000 pd1 00000000 pd2 00000000 pd3 00000000 rtrm 00sss sss rcnt 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 s rtss ssssssss rtsh s s s s s s s s s s s s s s s s rtsl s s s s s s s s s s s s s s s s rssa 0 0 0 0 0 s s s s s s s s s s s rash 0000ssss rasl s s s s s s s s s s s s s s s s t0cn 00000000 t0l 00000000 t0h 00000000 scon0 00000000 sbuf0 00000000 scon1 00000000 sbuf1 00000000 smd0 00000000 pr0 0 0 0 00 00000000000 smd1 00000000 pr1 0 0 0 00 00000000000 icdf 00000000 t1cn 00000000 t1l 00000000
maxq3120 high-precision adc mixed-signal microcontroller 20 ____________________________________________________________________ table 6. peripheral register bit reset values (continued) register bit register 15 14 13 12 11 10 9876543210 t1h 00000000 t2cna 00000000 t2h 00000000 t2rh 00000000 t2ch 00000000 ircn 00000000 t1cl 00000000 t1ch 00000000 t1md 00000000 t2cnb 00000000 t2v 0 0 0 00 00000000000 t2r 0 0 0 00 00000000000 t2c 0 0 0 00 00000000000 t2cfg 00000000 mcnt 00000000 ma 0 0 0 00 00000000000 mb 0 0 0 00 00000000000 mc2 0 0 0 00 00000000000 mc1 0 0 0 00 00000000000 mc0 0 0 0 00 00000000000 mc1r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 mc0r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 adcn s s s s 0 s s s 0 0 0 0 0 0 0 0 phc s 0 0 0 0 0 0 s ssssssss ad0 i i i ii iiiiiiiiiii ad1 i i i ii iiiiiiiiiii atrm 000s ssss lcra 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 lcfg 00000000 lcd[0..13] 00000000 note: bits marked with an ??have an indeterminate value upon reset. bits marked with an ??have special behavior upon reset. refer to the user? guide supplement for this device for more details.
maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 21 system timing the maxq3120 generates its internal system clock from an external high-frequency crystal. because the maxq3120 includes internal capacitors for this pur- pose, no external capacitors are required to use the high-frequency crystal. the maxq3120 should not be driven directly by an external clock source. a crystal warmup counter enhances operational relia- bility. each time the external crystal oscillation must restart, such as after exiting stop mode, the device initi- ates a crystal warmup period of 65,536 oscillations. this allows time for the crystal amplitude and frequency to stabilize before using it as a clock source. power management advanced power-management features minimize power consumption by dynamically matching the processing speed of the device to the required performance level. this means device operation can be slowed and power consumption minimized during periods of reduced activity. when more processing power is required, the microcontroller can increase its operating frequency. software-selectable clock-divide operations allow flexi- bility, selecting whether a system clock cycle is 1, 2, 4, or 8 oscillator cycles. by performing this function in soft- ware, a lower power state can be entered without the cost of additional hardware. for extremely power-sensitive applications, two addi- tional low-power modes are available. divide-by-256 power-management mode (pmm) (pmme = 1, cd1:0 = 00b) stop mode (stop = 1) in pmm, one system clock is 256 oscillator cycles, signifi- cantly reducing power consumption while the microcon- troller functions at reduced speed. the optional switchback feature allows enabled interrupt sources, such as the external interrupts and usarts, to cause the processor to quickly exit pmm mode and return to a faster internal clock rate. figure 2. clock sources maxq3120 glitch-free mux div 1 div 2 div 4 div 8 pwm clock divider selector default wa tchdog timer reset dog rwt reset power-on reset stop stop power-on reset swb interrupt/serial port reset stop power monitor real-time clock lcd controller wa tchdog reset clock generation system clock enable wa tchdog interrupt 32khz crystal crystal monitor enable input hf crystal crystal kill xdog startup timer clk input reset xdog count xdog done
maxq3120 power consumption reaches its minimum in stop mode. in this mode, the external high-frequency oscillator, system clock, and all code execution is halted. stop mode is exited when an enabled external interrupt pin is triggered, an external reset signal is applied to the reset pin, or the rtc time-of-day alarm is activated. the 32khz clock continues running during stop mode, enabling the following peripherals to keep running dur- ing stop mode. the rtc always continues running during stop mode. the lcd controller continues running during stop mode if it is running from the 32khz clock (lccs = 0). interrupts multiple reset sources are available for quick response to internal and external events. the maxq architecture uses a single interrupt vector (iv), single interrupt-ser- vice routine (isr) design. for maximum flexibility, inter- rupts can be enabled globally, individually, or by module. when an interrupt condition occurs, its individ- ual flag is set, even if the interrupt source is disabled at the local, module, or global level. interrupt flags must be cleared within the user-interrupt routine to avoid repeated interrupts from the same source. application software must ensure a delay between the write to the flag and the reti instruction to allow time for the inter- rupt hardware to remove the internal interrupt condition. asynchronous interrupt flags require a one-instruction delay and synchronous interrupt flags require a two- instruction delay. when an enabled interrupt is detected, software jumps to a user-programmable interrupt vector location. the iv register defaults to 0000h on reset or power-up, so if it is not changed to a different address, the user pro- gram must determine whether a jump to 0000h came from a reset or interrupt source. once software control has been transferred to the isr, the interrupt identification register (iir) can determine if a system register or peripheral register was the source of the interrupt. the specified module can then be inter- rogated for the specific interrupt source and software can take appropriate action. because the interrupts are evaluated by user software, the user can define a unique interrupt priority scheme for each application. the following interrupt sources are available. watchdog interrupt external interrupts 0 to 2 rtc time-of-day and subsecond alarms serial port 0 receive and transmit interrupts serial port 1 receive and transmit interrupts timer 0 overflow interrupt timer 1 overflow and external trigger interrupts timer 2 low compare, low overflow, capture/ compare, and overflow interrupts reset sources several reset sources are provided for microcontroller control. although code execution is halted in the reset state, the high-frequency oscillator and the 32khz oscilla- tor continue to oscillate. internal resets such as the power-on and watchdog resets assert the reset pin low. power-on reset an internal power-on reset circuit enhances system reli- ability. this circuit forces the device to perform a power-on reset whenever a rising voltage on dv dd climbs above the v rst level. at this point, the following events occur: all registers and circuits enter their reset state (except for the rtc, if it is battery-backed) the por flag (wdcn.7) is set to indicate the source of the reset code execution begins at location 8000h watchdog timer reset the watchdog timer functions are described in the maxq family user? guide . execution resumes at loca- tion 8000h following a watchdog timer reset. external system reset asserting the external reset pin low causes the device to enter the reset state. the external reset func- tions as described in the maxq family user? guide . execution resumes at location 8000h after the reset pin is released. i/o ports the microcontroller uses the type c and type d bidi- rectional i/o ports described in the maxq family user? guide . the use of two port types allows for maxi- mum flexibility when interfacing to external peripherals. each port has eight independent, general-purpose i/o pins and three configure/control registers. many pins support alternate functions such as timers or interrupts, which are enabled, controlled, and monitored by dedi- cated peripheral registers. using the alternate function automatically converts the pin to that function. high-precision adc mixed-signal microcontroller 22 ____________________________________________________________________
type c port pins have schmitt trigger receivers and full cmos output drivers, and can support alternate functions. the pin is either tri-stated or a weak pullup when defined as an input, dependent on the state of the corresponding bit in the output register. type d port pins have schmitt trigger receivers and full cmos output drivers, and can support alternate functions. the pin is either tri-stated or a weak pullup when defined as an input, dependent on the state of the corresponding bit in the output register. all type d pins also have interrupt capability. high-speed hardware multiplier the hardware multiplier module performs high-speed multiply, square, and accumulate operations, and can complete a 16-bit x 16-bit multiply-and-accumulate operation in a single cycle. the hardware multiplier consists of two 16-bit parallel-load operand registers (ma, mb), a 40-bit accumulator that is formed by three 16-bit parallel registers (mc2, mc1, and mc0), and a status/control register (mcnt). loading the registers can automatically initiate the operation, saving time on repetitive calculations. the accumulate function of the hardware multiplier is an essential element of digital fil- tering, signal processing, and proportional/integral/ derivative (pid) algorithm-based control systems. the hardware multiplier module supports the following operations: multiply unsigned (16 bit x 16 bit) multiply signed (16 bit x 16 bit) multiply-accumulate unsigned (16 bit x 16 bit) multiply-accumulate signed (16 bit x 16 bit) square unsigned (16 bit) square signed (16 bit) square-accumulate unsigned (16 bit) square-accumulate signed (16 bit) maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 23 maxq3120 pd.x sf direction sf enable mux mux po.x v ddio sf output v ddio weak i/o pad port pin interrupt flag flag pi.x or sf input eies.x type d port only detect circuit figure 3. type c/d port pin schematic
maxq3120 real-time clock a binary real-time clock keeps the time of day in absolute seconds with 1/256-second resolution. the 32-bit second counter can count up to approximately 136 years and be translated to calendar format by the application software. a time-of-day alarm and indepen- dent subsecond alarm can cause an interrupt, or wake the device from stop mode. the independent subsecond alarm runs from the same rtc, and allows the application to perform periodic interrupts up to 8 seconds with a granularity of approxi- mately 3.9ms. this creates an additional timer that can be used to measure long periods without performance degradations. traditionally, long time periods have been measured using multiple interrupts from shorter programmable timers. each timer interrupt required servicing, with each accompanying interruption slowing system operation. by using the rtc subsecond timer as a long-period timer, only one interrupt is needed, eliminating the performance hit associated with using a shorter timer. an internal crystal oscillator clocks the rtc using inte- grated 6pf load capacitors, and gives the best perfor- mance when mated with a 32.768khz crystal rated for a 6pf load. no external load capacitors are required. higher accuracy can be obtained by using the digital rtc trim function. the frequency accuracy of a crystal- based oscillator circuit is dependent upon crystal accu- racy, the match between the crystal and the oscillator capacitor load, ambient temperature, etc. programmable timers the maxq3120 incorporates one instance each of the timer 0, timer 1, and timer 2 peripherals. these timers can be used in counter/timer/capture/compare/pwm functions, allowing precise control of internal and exter- nal events. timer 2 supports optional single-shot, exter- nal gating, and polarity control options as well as carrier generation support for infrared transmit/receive functions using serial port 0. timer 0 the timer 0 peripheral includes the following: 8-bit autoreload timer/counter 13-bit or 16-bit timer/counter dual 8-bit timer/counter external pulse counter timer 1 the timer 1 peripheral includes the following: 16-bit autoreload timer/counter 16-bit capture 16-bit counter ? lock generation output timer 2 the timer 2 peripheral includes the following: 16-bit autoreload timer/counter 16-bit capture 16-bit counter 8-bit capture and 8-bit timer 8-bit counter and 8-bit timer infrared carrier generation support w atchdog timer an internal watchdog timer greatly increases system reliability. the timer resets the processor if software execution is disturbed. the watchdog timer is a free- running counter designed to be periodically reset by the application software. if software is operating cor- rectly, the counter is periodically reset and never reaches its maximum count. however, if software oper- ation is interrupted, the timer does not reset, triggering a system reset and optionally a watchdog timer inter- rupt. this protects the system against electrical noise or electrostatic discharge (esd) upsets that could cause uncontrolled processor operation. the internal watchdog timer is an upgrade to older designs with external watchdog devices, reducing system cost and simultaneously increasing reliability. the watchdog timer is controlled through bits in the wdcn register. its timeout period can be set to one of four programmable intervals ranging from 2 12 to 2 21 system clocks in its default mode, allowing flexibility to support different types of applications. the interrupt occurs 512 system clocks before the reset, allowing the system to execute an interrupt and place the system in a known, safe state before the device performs a total system reset. at 8mhz, watchdog timeout periods can be programmed from 512? to 61.7s, depending on the system clock mode. high-precision adc mixed-signal microcontroller 24 ____________________________________________________________________
in-circuit debug embedded debugging capability is available through the jtag-compatible tap. embedded debug hardware and embedded rom firmware provide in-circuit debugging capability to the user application, eliminat- ing the need for an expensive in-circuit emulator. figure 4 shows a block diagram of the in-circuit debug- ger. the in-circuit debug features include: hardware debug engine set of registers able to set breakpoints on register, code, or data accesses set of debug service routines stored in the utility rom the embedded hardware debug engine is an indepen- dent hardware block in the microcontroller. the debug engine can monitor internal activities and interact with selected internal registers while the cpu is executing user code. collectively, the hardware and software fea- tures allow two basic modes of in-circuit debugging: background mode allows the host to configure and set up the in-circuit debugger while the cpu continues to execute the application software at full speed. debug mode can be invoked from background mode. debug mode allows the debug engine to take control of the cpu, providing read/write access to internal reg- isters and memory, and single-step trace operation. serial peripherals the maxq3120 incorporates two 8051-style universal synchronous/asynchronous receiver/transmitters. the usarts allow the device to conveniently communicate with other rs-232 interface-enabled devices, as well as pcs and serial modems when paired with an external rs-232 line driver/receiver. the dual independent usarts can communicate simultaneously at different baud rates with two separate peripherals. the usart can detect framing errors and indicate the condition through a user-accessible software bit. the time base of the serial ports is derived from either a division of the system clock or the dedicated baud clock generator. the following table summarizes the operating characteristics as well as the maximum baud rate of each mode. serial port 0 contains additional functionality to support low-speed infrared transmission in combination with the pwm function of timer 2. when enabled in this mode, the serial port automatically outputs a waveform gener- ated by combining the normal serial port output wave- form with the pwm carrier waveform output by timer 2, using a logical or or logical nor function. the output of serial port 0 in this mode can be used to drive an infrared led to communicate using a fixed-frequency carrier modulated signal. depending on the drive strength required, the output may require a buffer when used for this purpose. maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 25 mode type start bits data bits stop bit max baud rate at 8mhz mode 0 synchronous 8 2mbps mode 1 asynchronous 1 8 1 250kbps mode 2 asynchronous 1 8 + 1 1 250kbps mode 3 asynchronous 1 8 + 1 1 250kbps figure 4. in-circuit debugger tap controller cpu debug engine debug service routines (utility rom) tms tck tdi tdo control breakpoint address d ata maxq3120
maxq3120 lcd driver the maxq3120 microcontroller incorporates an lcd driver that interfaces to common low-voltage displays. by incorporating the lcd driver into the microcon- troller, the design requires only an lcd glass rather than a considerably more expensive lcd module. every character in an lcd glass is composed of one or more segments, each of which is activated by selecting the appropriate segment and common signal. the microcontroller can drive up to 112 lcd glass seg- ments by multiplexing combinations of 28 segment (seg0?eg27) outputs and four common-signal out- puts (com0?om3). eight of the segment outputs can also be used as general-purpose port pins, if they are not needed to drive the lcd. the segments are easily addressed by writing to dedi- cated display memory. once the lcd driver settings and display memory have been initialized, the 14-byte display memory is periodically scanned, and the seg- ment and common signals are generated automatically at the selected display frequency. no additional proces- sor overhead is required while the lcd driver is running. unused display memory can be used for general-pur- pose storage. the design is further simplified and cost-reduced by the inclusion of software-adjustable internal voltage- dividers to control display contrast. if desired, contrast can also be controlled by an external resistance. the features of the lcd driver include the following: automatic lcd segment and common-drive signal generation four display modes supported: static (com0) 1/2 duty multiplexed with 1/2 bias voltages (com0, com1) 1/3 duty multiplexed with 1/3 bias voltages (com0, com1, com2) 1/4 duty multiplexed with 1/3 bias voltages (com0, com1, com2, com3) up to 28 segment outputs and four common-signal outputs 14 bytes (112 bits) of display memory adjustable frame frequency internal voltage-divider resistors eliminate require- ment for external components internal adjustable resistor allows contrast adjust- ment without external components flexibility to use external resistors to adjust drive voltages and current capacity a simple lcd-segmented glass interface example demonstrates the minimal hardware required to inter- face to a maxq3120 microcontroller. a two-character lcd is controlled, with each character containing seven segments plus decimal point. the lcd driver is configured for 1/2 duty cycle operation, meaning the active segment is controlled using a combination of segment signals, and com0 or com1 signals are used to select the active display. high-precision adc mixed-signal microcontroller 26 ____________________________________________________________________ figure 5. two-character, 1/2 duty, lcd interface example seg0 seg1 seg2 seg3 com0 seg0:7 connected to dark grey segments com1 connected to light grey segments seg4 seg5 seg6 seg7 maxq3120
analog front-end the maxq3120 microcontroller incorporates an analog front-end for dedicated analog-to-digital conversion. this peripheral converts and digitally filters two differ- ential signal channels with no cpu overhead. the two conversion channels operate completely in parallel, running at the same sample rate whether one channel or both channels are enabled. if one or both channels are not in use, they may be powered down to conserve supply current. the two input signals for each channel form a true differ- ential pair. each of the two signals (an0+ and an0- for channel 0, an1+ and an1- for channel 1) can vary across the entire +1v to -1v analog input range, without regard to the level of the other signal in the pair. the ini- tial stage for each channel is a programmable gain function (1x, 16x) that can be set by software indepen- dently for each channel. next, a second-order sigma- delta modulator samples each input signal. when using both channels to measure the same signal (as is the case when measuring voltage and current for power calculations), a phase-correction buffer is pro- vided to compensate for any phase shift between the two channels caused by external circuitry. the phase- correction buffer operates digitally on the output bit stream of one of the two channels and can delay either channel? bit stream with respect to the other channel? bit stream by up to 140 bits. next, the bit streams for the two channels travel through two digital sinc 3 lowpass filters, which convert the bit streams to 16-bit pcm values for additional processing. maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 27 figure 6. analog front-end block diagram channel 0 programmable gain (1x, 16x) an0+ an0- an1+ an0- channel1 programmable gain (1x, 16x) channel 0 sigma-delta modulator channel 1 sigma-delta modulator phase correction ad0 ad1 channel 0 sinc 3 filter channel 1 sinc 3 filter
maxq3120 applications information the low-power, high-performance risc architecture of the maxq3120 makes it an excellent fit for many portable or battery-powered applications that require cost-effective computing. the high-throughput core is complemented by a dual-differential channel, 16-bit sigma-delta adc, and 16-bit hardware multiplier-accu- mulator, allowing the implementation of sophisticated computational algorithms. applications benefit from a wide range of peripheral interfaces, allowing the micro- controller to communicate with many external devices. with integrated lcd support of up to 112 segments (4 x 28), applications can support complex user interfaces. displays are driven directly with no additional external hardware required. contrast can be adjusted using a built-in, adjustable resistor. the simplified architecture reduces component count and board space, critical factors in the design of portable systems. the maxq3120 is ideally suited for single-phase elec- tricity metering applications as well as other applica- tions that require high-precision analog-to-digital conversion and signal processing. additional documentation designers must have four documents to fully use all the features of this device. this data sheet contains pin descriptions, feature overviews, and electrical specifi- cations. errata sheets contain deviations from pub- lished specifications. the user? guides offer detailed information about programming, device features, and operation. the following documents can be down- loaded from www.maxim-ic.com/microcontrollers . the maxq3120 data sheet, which contains electri- cal/timing specifications and pin descriptions, avail- able at www.maxim-ic.com/maxq3120 . the maxq3120 errata sheet, available at www.maxim-ic.com/errata . the maxq family user? guide , which contains detailed information on core features and operation, including programming, avaliable at www.maxim- ic.com/maxqug . the maxq family user? guide: maxq3120 supplement , which contains detailed information on features specific to the maxq3120, available at www.maxim-ic.com/maxq3120ug . development and technical support a variety of highly versatile, affordably priced develop- ment tools for this microcontroller are available from maxim/dallas semiconductor and third-party suppliers, including: compilers in-circuit emulators integrated development environments (ides) jtag-to-serial converters for programming and debugging a partial list of development tool vendors can be found on our website at www.maxim-ic.com/microcontrollers . technical support is available through email at maxq.support@dalsemi.com . definitions offset error for an ideal converter, the first transition occurs at 0.5 lsb above zero. offset error is the amount of deviation between the measured first transition point and the ideal point. gain error with a full-scale analog voltage applied to the adc (resulting in all ones in the digital code), gain error is defined as the amount of deviation between the ideal transfer function and the measured transfer function (with the offset error removed). gain error is usually expressed in lsb or as a percentage of full-scale range (%fsr). power-supply rejection ratio power-supply rejection ratio (psrr) is the ratio of changes in the power supply (v) to changes in the con- verter output (v). it is typically measured in decibels. high-precision adc mixed-signal microcontroller 28 ____________________________________________________________________
appendix a: applying a lowpass filter (lpf) for application- optimized adc performance the maxq3120 gives a user application program direct access to the adc data stream right after its sinc3 fil- ters. this unique feature permits the maxq3120 to be optimized for its target applications. with the device? 8mips processing power and the 1-cycle mac, a linear fir filter can be easily computed in the user application program. this section provides a simple lp fir filter to improve the snr and thd performance of the maxq3120 for the power-metering application. filter specifications and coefficients input signal frequency (f in ) = 60hz sampling frequency (f s ) = 20833hz window = hamming cutoff frequency (attenuates after 7th harmonic) = 0.06 = 625hz cutoff frequency (for 21st harmonic) = 0.18 = 1875hz transition width = 0.35 = 3646hz filter length = 23 maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 29 filter_coefficient_0 -19 filter_coefficient_12 21893 filter_coefficient_1 -288 filter_coefficient_13 17547 filter_coefficient_2 -786 filter_coefficient_14 11739 filter_coefficient_3 -1402 filter_coefficient_15 6018 filter_coefficient_4 -1670 filter_coefficient_16 1627 filter_coefficient_5 -876 filter_coefficient_17 -876 filter_coefficient_6 1627 filter_coefficient_18 -1670 filter_coefficient_7 6018 filter_coefficient_19 -1402 filter_coefficient_8 11739 filter_coefficient_20 -786 filter_coefficient_9 17547 filter_coefficient_21 -288 filter_coefficient_10 21893 filter_coefficient_22 -19 filter_coefficient_11 23506 filter_coefficient_0 849 filter_coefficient_12 23295 filter_coefficient_1 1420 filter_coefficient_13 21720 filter_coefficient_2 2553 filter_coefficient_14 19291 filter_coefficient_3 4334 filter_coefficient_15 16269 filter_coefficient_4 6754 filter_coefficient_16 12966 filter_coefficient_5 9700 filter_coefficient_17 9700 filter_coefficient_6 12966 filter_coefficient_18 6754 filter_coefficient_7 16269 filter_coefficient_19 4334 filter_coefficient_8 19291 filter_coefficient_20 2553 filter_coefficient_9 21720 filter_coefficient_21 1420 filter_coefficient_10 23295 filter_coefficient_22 849 filter_coefficient_11 23840 1) lpf coefficients (up to 21st harmonic). note that these coefficients have been converted to 16-bit fixed-point numbers. a shift of 17 places is required after the multiply-accumulate operation. 2) lpf coefficients (up to 7th harmonic). note that these coefficients have been converted to 16-bit fixed-point numbers. a shift of 18 places is required after the multiply-accumulate operation.
+ denotes a pb-free/rohs-compliant device. maxq3120 filter results below is the summary of the snr and thd values before and after applying the above lpfs, for 60 maxq3120 units. an application engineer can easily implement his own favorite lowpass filters to optimize maxq3120 for his target applications. however, he does need to consider the filter complexity and its processor resource require- ment (cpu cycles and storage space) to strike an opti- mal balance. the above 23-tap lpf takes 23 x 2 bytes of ram and 107 clock cycles of the maxq3120 to com- plete. note that the number of cycles varies from filter to filter because the number of shifts required to nor- malize the multiply-accumulate result will vary. high-precision adc mixed-signal microcontroller 30 ____________________________________________________________________ snr thd condition min avg max min avg max before lpf 56.5 56.8 57.1 -84.5 -81.1 -77.3 after lpf, 21st harmonic 68.2 70.7 71.4 -85.8 -83.1 -79.4 after lpf, 7th harmonic 71.5 73.8 74.7 -88.9 -85.7 -82.0 selector guide part temp range program memory data memory lcd segments external interrupts usarts pin- package MAXQ3120-FFN -40? to +85? 16kword flash 256 word sram 112 3 2 80 mqfp MAXQ3120-FFN+ -40? to +85? 16kword flash 256 word sram 112 3 2 80 mqfp
maxq3120 high-precision adc mixed-signal microcontroller ____________________________________________________________________ 31 pin configuration 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 p1.4/seg15 p1.3/seg16 p1.2/seg17 p1.1/seg18 p1.0/seg19 dgnd dv dd n.c. n.c. p0.7/t2b p0.6/t2a 64 p0.0/sqw reset 32kout 32kin dv dd dgnd p3.7/rxd1 p3.6/txd1 p3.5 p3.4 p3.3/tck v bat agnd v ref n.c. n.c. an1+ an1- an0+ an0- av dd dgnd p3.2/tms p3.1/tdi p1.5/seg14 p1.6/seg13 p1.7/seg12 seg11 seg10 seg9 seg8 seg7 seg6 seg5 seg4 v lcd v lcd1 v lcd2 v adj seg3 seg2 seg1 dgnd hfxin hfxout dv dd seg0 com3 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 p0.5/int2/t1 p0.4/int1/t0 p0.3/int0/t0g p0.2/txd0 p0.1/rxd0 com2 com1 com0 p2.0/seg20 p2.1/seg21 p2.2/seg22 p2.3/seg23 p2.4/seg24 p2.5/seg25 p2.6/seg26 n.c. n.c. dgnd dv dd p2.7/seg27 p3.0/tdo mqfp maxq3120 top view
maxq3120 high-precision adc mixed-signal microcontroller 32 ____________________________________________________________________ t ypical operating circuit 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 p1.4/seg15 p1.3/seg16 p1.2/seg17 p1.1/seg18 p1.0/seg19 dgnd dv dd n.c. n.c. p0.7/t2b p0.6/t2a 64 p0.0/sqw reset 32kout 32kin dv dd dgnd p3.7/rxd1 p3.6/txd1 p3.5 p3.4 p3.3/tck v bat agnd v ref n.c. n.c. an1+ an1- an0+ an0- av dd dgnd p3.2/tms p3.1/tdi p1.5/seg14 lcd display p1.6/seg13 p1.7/seg12 seg11 seg10 seg9 seg8 seg7 seg6 seg5 seg4 v lcd v lcd1 v lcd2 v adj seg3 seg2 seg1 dgnd hfxin hfxout 8mhz dv dd seg0 com3 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 p0.5/int2/t1 p0.4/int1/t0 p0.3/int0/t0g p0.2/txd0 p0.1/rxd0 com2 com1 com0 p2.0/seg20 p2.1/seg21 p2.2/seg22 p2.3/seg23 p2.4/seg24 p2.5/seg25 p2.6/seg26 n.c. n.c. dgnd dv dd p2.7/seg27 p3.0/tdo maxq3120 infrared tx/rx 32.768khz rs-485 tx/rx voltage- divider ac line out serial eeprom current shunt ac neutral out ac line in ac neutral in
maxq3120 high-precision adc mixed-signal microcontroller maxim cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a maxim product. no circu it patent licenses are implied. maxim reserves the right to change the circuitry and specifications without notice at any time. maxim integrated products, 120 san gabriel drive, sunnyvale, ca 94086 408-737-7600 ____________________ 33 2005 maxim integrated products printed usa is a registered trademark of maxim integrated products, inc. is a registered trademark of dallas semiconductor corporation. quijano package information (the package drawing(s) in this data sheet may not reflect the most current specifications. for the latest package outline info rmation, go to www.maxim-ic.com/dallaspackinfo ) . revision history rev 0; 7/05: original release. rev 1; 8/05: added clarification to adc resolution condition (no missing codes, with software lowpass filter, see appendix a). deleted paragraph on integral nonlinearity.


▲Up To Search▲   

 
Price & Availability of MAXQ3120-FFN

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X